<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>房间信息管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript" src="${ctxStatic}/jquery/jquery-1.8.3.min.js"></script>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#btnReset").click(function(){
				 alert("确认重置吗？"); 
				window.location.href="${ctx}/room/tdcRoom/resetAllStatus";
			});
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/room/tdcRoom/">房间信息列表</a></li>
		<%-- <shiro:hasPermission name="room:tdcRoom:edit"><li><a href="${ctx}/room/tdcRoom/form">房间信息添加</a></li></shiro:hasPermission> --%>
	</ul>
	<form:form id="searchForm" modelAttribute="tdcRoom" action="${ctx}/room/tdcRoom/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>房间号：</label>
				<form:input path="roomNumber" htmlEscape="false" maxlength="10" class="input-medium" placeholder="请输入房间号"/>
			</li>
			<li><label>房间类型：</label>
					<form:select path="roomType" style="width:170px">
				<form:option value="" label="请选择"/>
					<form:option value="提审提讯" label="提审提讯"/>
					<form:option value="会见" label="会见"/>
					
					<form:options items="${fns:getDictList('marital')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</li>
			<li><label>房间状态：</label>
				
				<form:select path="roomStatus" style="width:170px">
				<form:option value="" label="请选择"/>
					<form:option value="使用中" label="使用中"/>
					<form:option value="空闲中" label="空闲中"/>
					
					<form:options items="${fns:getDictList('marital')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="btns"><input id="btnReset" class="btn btn-primary" type="button" value="重置"/></li>
			<li class="btns"><a href="${ctx}/room/tdcRoom/form"><input id="btnSubmit" class="btn btn-primary" type="button" value="添加房间"/></li></a></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
			
				<th>房间号</th>
				<th>房间类型</th>
				<th>房间状态</th>
				<shiro:hasPermission name="room:tdcRoom:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="tdcRoom">
			<tr>
				<td>
					${tdcRoom.roomNumber}
				</td>
				<td>
					${tdcRoom.roomType}
				</td>
				<td>
					${tdcRoom.roomStatus}
				</td>
				<shiro:hasPermission name="room:tdcRoom:edit"><td>
    				<a href="${ctx}/room/tdcRoom/form?id=${tdcRoom.id}">修改</a>
					<a href="${ctx}/room/tdcRoom/delete?id=${tdcRoom.id}" onclick="return confirmx('确认要删除该房间信息吗？', this.href)">删除</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
		
	</table>
	<div class="pagination">${page}</div>
</body>
</html>